# 构建后端 Go 服务
FROM golang:1.24-alpine AS builder
WORKDIR /app

# 复制 backend 目录下所有内容（包括子目录和文件）
COPY backend/ . 
RUN go build -o operator-admin

# 构建最终运行环境
FROM alpine:latest
WORKDIR /app
COPY --from=builder /app/operator-admin .
COPY frontend/dist ./public
# /data 由 K8s ConfigMap 挂载
CMD ["/app/operator-admin"]
EXPOSE 80